#include "co/co.h"
#include <QApplication>
#include <QDebug>
#include <iostream>
#include <memory>

using namespace std;

void test_shared_ptr(shared_ptr<int>& out)
{
	int a = 12;
	shared_ptr<int> pt(&a);
	cout << pt.use_count() << endl;
	shared_ptr<int> pt2 = pt;
	out = pt2;
	cout << pt.use_count() << endl;
}

int main(int argc, char** argv)
{
	QApplication app(argc, argv);

	go([=, &app]() {
			qDebug() << "first go";
			co::sleep(2000);
			qDebug() << "first sleep ok";
			});

	go([=]() {
			qDebug() << "go is not block";
			});

	app.exec();
	return 0;
}
